Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more idiomatic angular when parsing opts, and add a provider to allow setting of defaults #55

Merged
merged 15 commits into from
Jun 19, 2015

Conversation

jsdw
Copy link

@jsdw jsdw commented Jun 15, 2015

The provider allows default options to be set globally, along with an option to import Hammer's own presets if you defined them there. It merges those options in to any provided where appropriate.

In addition I strip down code duplication by normalizing opts to an array, takingcare (hopefully correctly!) to cater for custo mdirective and applying defaults eg doubletap.

Nice work! I hope this helps a little.

James added 15 commits June 15, 2015 14:58
…h will be used in any corresponding angular hm-X invocation (except custom), as well as import defaults from Hammer's own presets object.
…pts to array to avoid code duplication, 2. apply directive defaults properly if not hmCUstom, 3. rewrite how extending works to handle extending/applying defaults.
…zer opts to be used. unsure about how hammer applies defaults if empty recognizer opts supplied but this seems to be fine (ie defaults used if no overriding params)
…break if hammer included through other means and browserify is used, 2. simplify a bunch of code including event handler which doesn't need to check digest phase, 3. fix a bunch of bugs with the previous iteration, 4. allow options to target doubletap specifically using eventname, 5. better normalization so less code in link function
@RyanMullins
Copy link
Owner

I'm going to need to make some small changes to authorship and such before publishing this. Going to make a contributor list and change the copyright to be the group of us. Thanks for taking the time to do pretty much everything I wanted to do 6 months ago but haven't had time for.

@evernym
Copy link

evernym commented Aug 24, 2015

The bower version of the repo 2.1.10 doesn't consist of the changes in jsdw@4562fc4. Is there any plan to merge it to bower version of the repo? Because for now I am referring the commit directly in my bower.json file

@RyanMullins
Copy link
Owner

I will do this eventually, but I haven't been working on touch stuff much recently and therefore haven't had a chance to test it. If you find that this is pretty stable then I will tag a release and push to NPM and Bower.

@jsdw
Copy link
Author

jsdw commented Aug 24, 2015

I use this at work quite a lot with multiple hammer events (and others) soetimes attached to single elements, and everything has been ok thus far, but frankly I found HammerJS a bit of a pain working with - it doesnt feel very developer friendly for this sort of thing - and so I wouldn't be surprised if there were edge cases specifically regarding passing options through and using custom events.

One thing I noticed, iirc, is that click duration is ignored when you combine a hm-tap with a hm-pan. I believe the issue was with hammer rather than this plugin but didn't take the investigation very far as it wasn't too important at work.

@RyanMullins
Copy link
Owner

Well that last bit is fascinating. I will say that last I heard Hammer.js was going on the original author's back burner. Not sure what the current status is though, maybe someone took over.

@evernym
Copy link

evernym commented Sep 21, 2015

@RyanMullins I haven't found any issues till now. But, a new issue has popped up for iOS 9. I have opened a separate issue for that (hammerjs/hammerjs.github.io#28). But I guess for now you can published the above mentioned changes to npm and bower.

@runspired
Copy link

One thing I noticed, iirc, is that click duration is ignored when you combine a hm-tap with a hm-pan. I believe the issue was with hammer rather than this plugin but didn't take the investigation very far as it wasn't too important at work.

This should be fixed by the patch release we're working on. There was a leaky config issue, the buggy behavior of which apparently most of our tests relied upon.

@runspired
Copy link

But, a new issue has popped up for iOS 9

We haven't begun looking at iOS9 yet, but if there is actually an iOS9 specific issue I'll take a gander it's related to the new force-touch API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants